<?php
/**
 * 极光聊天室初始化
 */
global $_W, $_GPC;
$config = $this->getConfig($_W['uniacid']);
$appkey = $config['jmkey'];
$appsecret = $config['jmsecret'];
//毫秒时间戳
list($msec, $sec) = explode(' ', microtime());
$timestamp = (float)sprintf('%.0f', (floatval($msec) + floatval($sec)) * 1000);
$random_str = $this->getRandomStr(32);
$signature = md5("appkey=" . $appkey . "&timestamp=" . $timestamp . "&random_str=" . $random_str . "&key=" . $appsecret);
return $this->getresult(0, '极光初始化参数', ['code' => 200, 'appkey' => $appkey, 'random_str' => $random_str, 'signature' => $signature, 'timestamp' => $timestamp, 'appsecret' => $appsecret]);